import Vue from 'vue'
import VueRouter from "vue-router";

// import Home from '@/views/home.vue'
// import Detail from '@/views/detail.vue'
// import LoginPage from '@/views/loginPage.vue'
// import Register from '@/views/register.vue'
// // 引入二级路由
// import Main from '@/views/main.vue'
// import Find from '@/views/find.vue'
// import Massage from '@/views/massage.vue'
// import My from '@/views/my.vue'
Vue.use(VueRouter)

const router = new VueRouter({
    routes:[
        {
            path:'/',
            redirect:'/home/main'
        }
        ,
       {
        // 一级路由
        path:'/home',
        component:() => import('@/views/home.vue'),
        // 二级路由
        children:[
            {
                path:'main',
                component:() => import('@/views/main.vue'),

            },
            {
                path:'find',
                component:() => import('@/views/find.vue'),

            },
            {
                path:'massage',
                component:() => import ('@/views/massage.vue'),

            },
            {
                path:'my',
                component:() => import('@/views/my.vue'),


            }

        ]
        
       },
       {
        path:'/detail',
        component:() => import ('@/views/detail.vue'),
       },
       {
        path:'/loginPage',
        component:() => import ('@/views/loginPage.vue'),
       },
       {
        path:'/register',
        component:() => import ('@/views/register.vue'),
       },
       {
        path:'/collect',
        component:() => import ('@/views/collect.vue'),
       },
       {
        path:'/rent',
        component:() => import ('@/views/rent.vue'),
       },
       {
        path:'/maphouse',
        component:() => import ('@/views/maphouse.vue'),
       },
       {       
        path:'/citylist',
        component:() => import ('@/views/citylist.vue'),
    },
    {       
        path:'/gorent',
        component:() => import ('@/views/gorent.vue'),
    }
    ]
})
export default router